<template>
  <div>
    <el-tooltip class="item" effect="light" placement="bottom-end">
      <div slot="content">
        {{ tooltip.content[0] }}<br />{{ tooltip.content[1] }}
      </div>
      <el-progress
        :percentage="config.value"
        :stroke-width="config.strokeWidth"
        :color="config.customColors"
        :text-inside="true"
        :format="getformatter"
      ></el-progress>
    </el-tooltip>
  </div>
</template>
<script>
export default {
  data() {
    return {
      config: {
        value: 19.5,
        strokeWidth: 26,
        customColors: [
          { color: "rgba(243, 72, 54)", percentage: 20 },
          { color: "rgba(255, 207, 0)", percentage: 60 },
          { color: "rgba(129, 210, 30)", percentage: 100 },
        ],
      },
      tooltip: {
        content: ["评分A:40", "评分B:50"],
      },
    };
  },
  methods: {
    getformatter() {
      return `健康状态:${this.config.value}`;
    },
  },
};
</script>
